package com.remote.core;

import java.util.Map;

import javax.annotation.PostConstruct;

import org.springframework.beans.factory.annotation.Autowired;

import ch.ethz.ssh2.Connection;

public abstract class RemoteCommandAdaptor {

	@Autowired
	private RemoteCommandTemplete remoteCommandTemplete;

	protected Connection conn;
	@PostConstruct
	public void init() {
		conn = remoteCommandTemplete.getConnection();
	}

	public Connection getConn() {
		return conn;
	}

	public void setConnInfo(Map<String, String> connInfo) {
		conn = remoteCommandTemplete.getConnection(connInfo.get("ip"), connInfo.get("username"),
				connInfo.get("password"));
	}

}
